package ooday02;
//子类
public class Teacher extends Person{
    double salary;
    //无参构造
    Teacher(){

    }
    //有参构造
    Teacher(String name,int age,String address,double salary){

        super(name,age,address);//此处的代替下面的三句话

//        this.name=name;
//        this.age =age;
//        this.address = address;
        this.salary = salary;

    }
    //方法
    void tech(){
        System.out.println(name+"正在上课教书.....");
    }
    void sayHi(){//老师类重写
        System.out.println("我叫"+name+",今年："+age+"岁了，家住"+address
                          +",工资为："+salary );
    }


}
